package com.laolang.shop.modules.product.logic.admin.impl;

import com.github.pagehelper.PageInfo;
import com.laolang.shop.common.core.domain.Page;
import com.laolang.shop.common.core.util.CommonUtil;
import com.laolang.shop.modules.product.logic.admin.ProductAttrGroupAdminLogic;
import com.laolang.shop.modules.product.pojo.attr.admin.vo.ProductAttrGroupPageVo;
import com.laolang.shop.modules.product.service.ProductAttrGroupService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author khlbat
 * @version 1.0
 * @date 2020/11/4 15:50
 */
@Slf4j
@AllArgsConstructor
@Service
public class ProductAttrGroupAdminLogicImpl implements ProductAttrGroupAdminLogic {

    private final ProductAttrGroupService productAttrGroupService;

    @Override
    public Page<ProductAttrGroupPageVo> page(Integer page, Integer size, Long cateId) {
        PageInfo<ProductAttrGroupPageVo> pageInfo = productAttrGroupService.page(page, size, cateId);
        return CommonUtil.pageInfo2Page(pageInfo);
    }
}
